<template>
  <div>
    <HeadersNewsHeader v-if="isNews"/>
    <HeadersDefaultHeader v-else/>
  </div>
</template>

<script setup lang="ts">
const isNews = ref(false);

const router = useRouter();
const route = useRoute();
// 仅新闻详情页顶部不是透明的
const R = /^\/news\/[a-zA-Z0-9_]+$/
isNews.value = R.test(route.path)
router.afterEach((to: { path: string }) => {
  isNews.value = R.test(to.path);
});
</script>

<style lang="scss" scoped></style>
